Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect the absence of setImmediate for nodejs-v0.8 and lesser #271

Closed
wants to merge 1 commit into from

Conversation

hmalphettes
Copy link

And fallback to process.nextTick.

Here is how it fails on cloudfoundry's v0.8.2 without this patch:
/var/vcap/data/dea/apps/stoic-0-bda8723f9d67b2926c82dcae327b7902/app/node_modules/async/lib/async.js:90
       async.setImmediate = setImmediate;
                            ^
ReferenceError: setImmediate is not defined
   at /var/vcap/data/dea/apps/stoic-0-bda8723f9d67b2926c82dcae327b7902/app/node_modules/async/lib/async.js:90:30
   at Object. (/var/vcap/data/dea/apps/stoic-0-bda8723f9d67b2926c82dcae327b7902/app/node_modules/async/lib/async.js:947:2)
   at Module._compile (module.js:449:26)

@dougwilson
Copy link
Contributor

+1

3 similar comments
@prust
Copy link

prust commented Mar 21, 2013

+1

@jalateras
Copy link

+1

@victusfate
Copy link

+1

@Grigore147
Copy link

+1, Node v.0.8.17

@hmalphettes
Copy link
Author

As a workaround, I use a setImmediate schim: https://github.com/NobleJS/setImmediate

npm install setimmediate

And before using async:

require('setimmediate');
require('async');

@boutils
Copy link

boutils commented Apr 8, 2013

+1

@hmalphettes
Copy link
Author

An almost equivalent patch is committed for 0.2.7 here: b00f5f4

I am guessing @caolan preferred to look for "typeof setImmediate !== 'undefined' " rather than "typeof setImmediate === 'function' "
in case setImmediate ends up to no be a function.

Anyways all is good in node-0.8 land again.
Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants